<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	     原型继承： 子类.prototype=new 父类
		<script>
			//父类
			function Parent(name,age){//私有
				this.name=name;
				this.age=age;
			}
			Parent.prototype.show=function(){//公有
				console.log("111");
			}
			let p=new Parent("lili",20);
			console.log(p);
			
			//子类
			function Child(job){//私有
				this.job=job
			}
			Child.prototype=new Parent("lisa",18);//原型继承
			
			Child.prototype.myjob=function(){//公有
				console.log("222");
			}
			let c=new Child("程序员");
			console.log(c);
		</script>
	</body>
</html>
